home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / musicali / splib52d.lha / superplay-lib_DEV / Programmers / Oberon-2 / Interfaces / spObjects.mod next >
Text File  |  1996-11-15  |  8KB  |  206 lines

  1. (********************************************************************
  2.  
  3. :Program.     spObjects.mod
  4. :Contents.    interface module for superplay objects
  5. :Copyright.   © 1994 by Andreas R. Kleinert
  6. :Language.    Oberon-2
  7. :Translator.  A+L Amiga Oberon Compiler V3.11d
  8. :History.     V2.1  indy  25-Dec-95 first translation of c include
  9. :History.     V2.2  indy  05-Jul-96 update: c include V2.2(21.10.1995)
  10. *********************************************************************)
  11.  
  12. MODULE spObjects;
  13.  
  14. (*
  15.   $VER: spObjects 2.2 (5.7.96)
  16.  
  17.   This Oberon-2 interface module contains the c-includes:
  18.   -------------------------------------------------------
  19.     spobjects/spobjectbase.h
  20.       Version    : 1.2
  21.       Date       : 18.01.1994
  22.       Written by : Andreas R. Kleinert
  23.  
  24.     spobjects/spobjects.h
  25.       Version    : 2.2
  26.       Date       : 21.10.1995
  27.       Written by : Andreas R. Kleinert
  28. *)
  29.  
  30.  
  31. IMPORT
  32.   e   *: Exec;
  33. (*****************************************************************************)
  34.  
  35.  
  36. TYPE
  37.   SPObjectBasePtr  * = UNTRACED POINTER TO SPObjectBase;
  38.   ObjectNodePtr    * = UNTRACED POINTER TO ObjectNode;
  39.   SampleListPtr    * = UNTRACED POINTER TO SampleList;
  40.   SampleEntryPtr   * = UNTRACED POINTER TO SampleEntry;
  41.   CheckFilePtr     * = UNTRACED POINTER TO CheckFile;
  42.  
  43.  
  44.   ObjectNode * = STRUCT(node *: e.Node) (* chaining Node *)
  45.  
  46.     version          * : LONGINT;           (* Library-Version of spobject           *)
  47.  
  48.     objectType       * : LONGINT;           (* see below                             *)
  49.  
  50.     fileName         * : ARRAY 108 OF CHAR; (* use 30, as in struct FileInfoBlock    *)
  51.  
  52.     typeID           * : ARRAY 32 OF CHAR;  (* e.g. "MED"                            *)
  53.     typeCode         * : LONGINT;           (* ... and its appropriate Code,  ,      *)
  54.                                             (* assigned by superplay.library LATER.  *)
  55.  
  56.     subTypeNum       * : LONGINT;           (* actually available SubTypes           *)
  57.                                             (* (maximum 16) of the spobject.         *)
  58.  
  59.     subTypeID        * : ARRAY 16, 16 OF CHAR; (* e.g. "MMD0" or "MMD1"                 *)
  60.     subTypeCode      * : ARRAY 16 OF LONGINT;  (* ... and their appropriate Codes,      *)
  61.                                                (* assigned by superplay.library LATER.  *)
  62.  
  63.     backgroundReplay * : LONGINT;           (* Runs in the Background ? (Boolean)    *)
  64.  
  65.     (* size may grow with bigger spo_Version, see below *)
  66.  
  67.     (* (No changes from V1 to V2 : accept both !)       *)
  68.   END;
  69.  
  70.  
  71. CONST
  72.   version - = 2;                    (* If this Version, which depends on the *)
  73.                                     (* spobject's Library-Version, is set,   *)
  74.                                     (* it is guaranteed, that at least the   *)
  75.                                     (* above information is available.       *)
  76.  
  77.    (* ^ DO NOT USE THIS DEFINE IN SOURCECODE !  *)
  78.    (*   AVOID INCREASING IT VIA RECOMPILATION ! *)
  79.   
  80.   objectTypeNone      - = 0;
  81.   objectTypeUnknown   - = objectTypeNone;
  82.   objectTypeIllegal   - = 0FFFFFFFFH;
  83.   
  84.   objectTypeSample    - = 1;  (* Raw Sample                 *)
  85.   objectTypeModule    - = 2;  (* Specific Sound Module      *)
  86.   
  87.   (* There may be more types in the future : simply reject unknown types. *)
  88.  
  89.  
  90.   (* ----------------------------------------------------------------------- *)
  91.  
  92. TYPE                                          (* Header of "SampleEntry"-List *)
  93.   SampleList * = STRUCT(entryList *: e.List); (* List itself                  *)
  94.     numEntries * : LONGINT;                   (* number of entries in List    *)
  95.   END;
  96.  
  97.  
  98.   SampleEntry * = STRUCT(node*: e.Node) (* may e.g. contain SampleData *)
  99.                                         (* the chaining Node           *)
  100.  
  101.     version       * : LONGINT;         (* SPObject's Version (2)      *)
  102.     type          * : LONGINT;         (* Sample ?                    *)
  103.  
  104.     (* The following entries are only valid, if type is == typeSample *)
  105.  
  106.     sampleBuffer  * : e.APTR;          (* SampleData (CHIP-Ram)       *)
  107.     sampleSize    * : LONGINT;         (* size of SampleData in Bytes *)
  108.  
  109.     sampleBits    * : LONGINT;         (* 8, 16                       *)
  110.     samplesPerSec * : LONGINT;         (* as needed with audio.device *)
  111.     volume        * : LONGINT;         (* as needed with audio.device *)
  112.  
  113.     (* more entries may follow in the future *)
  114.   END;
  115.  
  116.  
  117. CONST
  118.   typeNone    - = 0;
  119.   typeUnknown - = typeNone;
  120.   typeIllegal - = 0FFFFFFFFH;
  121.   
  122.   typeSample  - = 1; (* Entry contains Sample Data *)
  123.  
  124.   (* There may be more types in the future : simply reject unknown types.
  125.      Do not examine unknown SampleEntry-Types. They may contain data,
  126.      which is structured different from the above in the future !
  127.   *)
  128.  
  129.  
  130.   (* -----------------------------------------------------------------------
  131.  
  132.     This structure has to be passed to SPObject's SPO_CheckFileType()
  133.     function, if media other than SPO_MEDIUM_DISK are used for reading.
  134.     This is supported since superplay.library V2 and may be ignored by
  135.     SPObjects for compatibility reasons. To prevent older SPO_CheckFileType()
  136.     functions from crashing, superplay.library will create a dummy-file and
  137.     pass it's handle also ...
  138.     ("You wanna something to check ? - Here you get it !")
  139.  
  140.     In the V3-SPObject specification this structure may HAVE TO be
  141.     examined, then. In the current V2-specification this is not the case.
  142.   *)
  143.     
  144.  
  145. TYPE
  146.   CheckFile * = STRUCT
  147.     medium * : LONGINT;   (* MEDIUM_...     *)
  148.     future * : LONGINT;   (* as usual       *)
  149.   END;
  150.   (* -----------------------------------------------------------------------*)
  151.  
  152.    (* An external support-library for the superplay.library is called a
  153.       "spobject".
  154.       Each spobject has to contain a "SPO_ObjectNode" structure (as follows)
  155.       in its Library-Header, which later will be READ and MODIFIED by
  156.       the superplay.library.
  157.       Because the superplay.library supports three different sorts
  158.       of SPObjects at the time (internal, independent and external),
  159.       there are three different types of this structure (might be more in
  160.       the future), which can be identified via their "spo_ObjectType".
  161.    *)
  162.  
  163.    (* The Construction of a spobject :
  164.       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  165.  
  166.       The Library Base
  167.       ----------------
  168.  
  169.       Version MUST be 1 yet, Revision can be set freely
  170.  
  171.       (see structure described below)
  172.  
  173.  
  174.       The Function Table
  175.       ------------------
  176.  
  177.       (see <pragmas/spobjects.h> or Reference_ENG.doc)
  178.  
  179.    *)
  180.  
  181. (* *************************************************** *
  182.  * *                                                 * *
  183.  * * Library base Definition for spobjects           * *
  184.  * *                                                 * *
  185.  * *************************************************** *)
  186.  
  187. TYPE
  188.   SPObjectBase   - = STRUCT (libNode - : e.Library) (* Exec LibNode                   *)
  189.     spObject*  : ObjectNodePtr;       (* POINTER to initialized         *)
  190.                                       (* SPO_ObjectNode                 *)
  191.                                       (* Define it somewhere else,      *)
  192.                                       (* then initialize this pointer.  *)
  193.     reserved*: ARRAY 32 OF LONGINT;   (* Reserved for future expansion. *)
  194.                                       (* Always NULL yet (Version 1).   *)
  195.  
  196.     (*
  197.       Private data of the spobject, not to be accessed
  198.       by superplay.library, may follow.
  199.     *)
  200.   END;
  201.  
  202. VAR
  203.   base *: SPObjectBasePtr;
  204.  
  205. END spObjects.
  206.